<?php
/**
 * Created by PhpStorm.
 * User: gzc0918
 * Date: 2021-08-06
 * Time: 23:24
 */

namespace IMooc;


class DatabaseInstance
{
    //单例模式
    protected static $db;
    private function __construct()
    {
    }
    static function getInstance()
    {
        if( self::$db){
            return self::$db;
        }else{
            self::$db = new self();
            return self::$db;
        }
    }

    //链式调用，链式调用的秘诀就是在方法中return $this
    public function where($where)
    {
        return $this;
    }
    public function limit($limit)
    {
        return $this;
    }
    public function order($order)
    {
        return $this;
    }
}